home *** CD-ROM | disk | FTP | other *** search
-
- SEARCH Michael J. Mefford
-
- Purpose: Searches all or specified directories on a disk for either designated
- filenames or the first occurrence of character strings within files.
-
- Format: SEARCH [filespec] [string][/P][/C][/B]
-
- Remarks: SEARCH defaults to a diskwide search of all subdirectories on the
- current disk. You can specify a different drive and/or a pathname as
- part of the optional filespec parameter. Filename searches support
- the DOS * and ? wildcards. Character strings within files are
- identified by putting them in quotation marks. (The strings may
- themselves include a pair of quotation marks.) Pressing either
- Ctrl-Break or Ctrl-C terminates SEARCH manually.
-
- To redirect the output of the SEARCH command to a printer, add /P to
- the command line, as shown in the first example below. Adding a
- similar /C switch will make the search for a character string
- case-sensitive.
-
- When searching for a character string, SEARCH normally ignores .COM
- and .EXE files. While this saves time, there may be occasions when
- you want to find copyright notices, error messages, et al. in an
- executable file. To include binary files in the search, add the /B
- parameter on the command line.
-
- Example: To print out a list all the .COM files in the \PROG subdirectory of
- your current drive, you would enter
-
- SEARCH \PROG\*.COM/P
-
- Example: To find which of the file(s) in your \LETTERS subdirectory contained
- the salutation, Dear Miss Jones, enter
-
- SEARCH \LETTERS "Dear Miss Jones"
-
- Notes: SEARCH returns a line number, based on the number of previous
- carriage returns in the file, when it finds a string. It reports
- only the first occurrence of the string in each file.